package com.luoye.lj.platform.model.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Dave Liu
 * Date: 15-10-15
 * Time: 上午11:31
 * To change this template use File | Settings | File Templates.
 */
public enum DeleteMark {
    OK(0,"正常"),DELETED(1,"删除"),UNKNOWN(-1,"未知状态");

    public int code;
    public String description;
    DeleteMark(int code, String description){
        this.code=code;
        this.description=description;
    }

    public static DeleteMark getByCode(int code){
        switch (code){
            case 0:
                return OK;
            case 1:
                return DELETED;
            default:
                return UNKNOWN;
        }
    }

    @Override
    public String toString() {
        return description;
    }

    public static List<DeleteMark> getAll(){
        List<DeleteMark> list=new ArrayList<DeleteMark>();
        list.add(OK);
        list.add(DELETED);
        return list;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
